package io;

import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;
public class Text {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("note2.txt",true);
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入内容,若输入exit退出:");
        String date = scanner.nextLine();
        while (!("exit".equalsIgnoreCase(date))){
            fos.write(date.getBytes(StandardCharsets.UTF_8));
            System.out.println("输入内容:");
            date = scanner.nextLine();
        }
        fos.close();

    }
}
